class Solution:
    def isAnagram(self, s,t):
        dict1={}
        for c in s:
            if  c not in dict1:
                dict1[c] = 1
            else:
                dict1[c] +=1
        for c in t:
            if c not in dict1:
                return False
            else:
                dict1[c] -=1
        for c in dict1:
            if dict1[c] != 0:
                return False

        return True



newsss=Solution()
s="anagram"
t="anagrma"
print(newsss.isAnagram(s, t))